package com.wang.commom.utils;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: tiger
 * @author: tiger
 * @create: 2024-10-15 11:49
 * @Description 客户端工具类 TODO
 */

public class ServletUtils {

    /**
     * 获取request
     */
public  static HttpServletRequest getRequest(){
    return getRequestAttributes().getRequest();
}

    public static ServletRequestAttributes getRequestAttributes()
    {
        RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
        return (ServletRequestAttributes) attributes;
    }
}
